package com.zs.toolbox.web2j.system.core.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zs.toolbox.web2j.system.core.entity.WtUserEntity;
import com.zs.toolbox.web2j.system.core.entity.WtUserWithRoleEntity;

import java.util.List;

/**
 * <p>
 * 用户基本信息表 服务类
 * </p>
 *
 * @author eric.zhang
 * @since 2018-09-21
 */
public interface WtUserService extends IService<WtUserEntity> {

    WtUserEntity selectByUsernameOrPhoneOrEmail(String username);

    String createrToken(WtUserEntity wtUserEntity);


    void saveNewUser(WtUserEntity saveEntity);

    WtUserEntity getEntityByPhoneOrEmail(String phoneOrPassword);

    void changePasswordByPhoneOrEmail(String phoneOrEmail, String newPassword);

    boolean matchPassword(String rawPassword, String encodePassword);

    void bindPhone(Long userId, String phone);

    void unbindPhone(Long userId, String phone);

    void bindeEmail(Long userId, String email);

    void unbindEmail(Long userId, String email);

    WtUserWithRoleEntity getUserWithRoleById(Long id);

    void saveUserRole(Long userId, List<String> roleIds, Long userId1);
}
